// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';



/** 获取动态数据 **/
export async function listMoment(querys?: object) {
  return request('/moment/list', {
    method: 'GET',
    params: querys
  });
}

// 根据id查询
export async function getMoment(id: string) {
  return request('/moment/'+id, {
    method: 'GET'
  });
}

/** 更新动态 */
export async function updateMoment(id: string, data: any) {
  return request('/moment/'+id, {
    method: 'PATCH',
    data
  });
}

/** 新建动态 */
export async function addMoment(data: any) {
  return request('/moment', {
    method: 'POST',
    data
  });
}

/** 删除动态 */
export async function removeMoment(id: string) {
  return request('/moment/'+id, {
    method: 'DELETE'
  });
}